<%--
  Created by IntelliJ IDEA.
  User: yx
  Date: 2020/9/11
  Time: 14:12
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">
    <script type="text/javascript" src="/js/news/jquery-1.9.1.js"></script>
    <script type="text/javascript" src="/js/base/baseTwo.js?20201110.4"></script>
    <style>
        html, body {
            width: 100%;
            height: 100%;
            background: #fff;
        }
        body {
            margin: 0;
            font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
            font-size: 14px;
            line-height: 20px;
            color: #333;
            background-color: #e6e6e6;
        }
        .header{
            position: fixed;
            background: #2b579a;
            color: #e6e6e6;
            height: 40px;
            line-height: 40px;
            top: 0;
            right: 0;
            left: 0;
            z-index: 1030;
        }
        .headerTitle{
            margin-left: 20px;
        }
        .content{
            background-color: #e6e6e6;
            padding-top: 75px;
            padding-right: 20px;
            padding-left: 20px;
            padding-bottom: 10px;
        }
        .contentPreview{
            line-height: normal;
            margin-right: auto;
            margin-left: auto;
            margin-bottom: 15px;
            max-width: 795px;
            min-height: calc(100% - 100px);
            border-radius: 1px;
            -moz-box-shadow: 0 0 10px 5px #888;
            -webkit-box-shadow: 0 0 10px 5px #888;
            box-shadow: 0 0 10px 5px #888;
            background-color: #FFF;
        }
        .contentBox{
            position: relative;
            max-width: 94%;
            word-wrap: break-word;
            word-break: break-all;
            margin: 0px auto;
            padding-top: 3%;
            padding-bottom: 10%;
            z-index: 0;
        }
        img{
            width: 100%;
        }
    </style>
</head>
<body>
    <div class="header">
        <div class="headerTitle"></div>
    </div>
    <div class="content">
        <div class="contentPreview">
            <div class="contentBox">

            </div>
        </div>
    </div>
    <script>
        var module = '';
        var aid = '';
        if(location.search&&location.search.split('?AID=')[1]){
            aid = location.search.split('?AID=')[1].split('&')[0];
            module = location.search.split('?AID=')[1].split('&MODULE=')[1];
        }

        $.ajax({
            url: "/wordToHtmlPrivew",
            data: {
                module:module,
                aid:aid
            },
            type: "POST",
            success: function(res) {
                var htmlStr = '<p>文档加载失败！</p>';
                if(res.flag){
                    var name = res.data.attachName
                    htmlStr = res.data.htmlWordContent;
                    $('.headerTitle').html(name);
                    $('title').html('文档预览 -'+name);
                }else{
                    alert('文档加载失败！');
                    $('title').html('文档预览 ');
                }
                $('.contentBox').html(htmlStr);
                var img = $('img');
                if(img.length > 0){
                    imgReloadWidth(img);
                }

            }
        });

    </script>
</body>
</html>
